<template>
  <div class="page_padding bonus_add">
    <MyNavBar @goback="goback" :title="titlePage" />
    <div class="content">
      <div v-if="remarkList.length" @click="lookTips" class="top_tips">
        <van-icon name="info-o" />
        点击查看{{ activeTab == '1' ? '加' : '减' }}分项构成说明
      </div>
      <div class="cont_tit" v-if="$route.query.id">
        <van-row>
          <van-col span="4">
            <div class="iconfont icontouxiang6 peoIcon"></div>
          </van-col>
          <van-col span="20" class="info_deta">
            <p>
              {{ info.userName }}
              <span>{{ info.orgName }}</span>
            </p>
            <p>{{ info.title }}</p>
          </van-col>
        </van-row>
      </div>
      <div class="fill">
        <div class="cont_box">
          <div class="category">
            <div class="list_text_title">
              <span class="text title-text">*申请季度</span>
            </div>
            <div class="texe_select">
              <van-radio-group @change="quarterChange" v-model="quartYM" direction="horizontal">
                <van-radio v-for="(item, index) in yearQuater" :key="index" :name="item.value">
                  {{ item.text }}
                </van-radio>
              </van-radio-group>
            </div>
          </div>

          <div class="depar_box">
            <div class="department">
              <div class="list_text_title">
                <span class="text title-text">*具体人员</span>
              </div>
              <div class="depart_con">
                <div class="depart_list">
                  <div class="depart_list_name">请选择人员</div>
                  <div class="depart_list_val" @click="onPickerShow(1)">
                    {{ pickerValueQ ? pickerValueQ : '请选择人员' }}
                    <van-icon name="arrow" size="16" />
                  </div>
                  <van-popup v-model="showPickerQ" round position="bottom">
                    <van-picker
                      show-toolbar
                      :columns="columnsPeoples"
                      default-index="0"
                      @cancel="showPickerQ = false"
                      @confirm="onConfirmQ" />
                  </van-popup>
                </div>
              </div>
            </div>
          </div>

          <!-- 加分项类别 -->
          <div class="category">
            <div class="list_text_title">
              <span class="text title-text">{{ activeTab == '1' ? '加' : '减' }}分项类别</span>
            </div>
            <div class="category_con">
              <van-radio-group v-model="category" class="option_item">
                <van-radio
                  @click="clickRadio(item)"
                  :name="item.id"
                  v-for="(item, index) in levelOption1"
                  :key="item.id">
                  <template #icon="props">
                    <div :class="['category_list', { active: props.checked }]">{{ index + 1 }}、{{ item.label }}</div>
                  </template>
                </van-radio>
              </van-radio-group>
            </div>
          </div>

          <!-- 加分项级别 -->
          <div class="category" v-if="levelOption2.length > 0">
            <div class="list_text_title">
              <span class="text title-text">{{ level2Name }}</span>
            </div>
            <div class="category_con">
              <van-radio-group v-model="level2" class="option_item">
                <van-radio
                  :name="item.id"
                  @click="clickRadioSec(item)"
                  v-for="(item, index) in levelOption2"
                  :key="item.id">
                  <template #icon="props">
                    <p :class="['category_list', { active: props.checked }]">{{ index + 1 }}、{{ item.label }}</p>
                  </template>
                </van-radio>
              </van-radio-group>
            </div>
          </div>

          <!-- 加分项级别3 -->
          <div class="category" v-if="levelOption3.length > 0">
            <div class="list_text_title">
              <span class="text title-text">{{ level3Name }}</span>
            </div>
            <div class="category_con">
              <van-radio-group v-model="level3" class="option_item">
                <van-radio
                  :name="item.id"
                  @click="clickRadioThr(item)"
                  v-for="(item, index) in levelOption3"
                  :key="item.id">
                  <template #icon="props">
                    <p :class="['category_list', { active: props.checked }]">{{ index + 1 }}、{{ item.label }}</p>
                  </template>
                </van-radio>
              </van-radio-group>
              <p
                class="tips_r"
                v-if="
                  level3 == '5-02-01-01' ||
                  level3 == '5-02-02-01' ||
                  level3 == '5-02-03-01' ||
                  category === '7-08-00-00'
                ">
                提示：
                <span class="tips_r_color">请在证明材料处上传领导批示的证明材料！</span>
              </p>
            </div>
          </div>
          <!-- 加分项说明 -->
          <div class="entry_list" v-for="(item, index) in allData" :key="index">
            <BoardSound :listData="item" :showVoice="false" :showWord="true"></BoardSound>
          </div>
          <!-- 附件 -->
          <div class="annex">
            <!-- 图片/视频 -->
            <div class="img_video">
              <div class="list_text_title">
                <span class="text title-text">证明材料</span>
              </div>
              <div class="up_box">
                <ImgUpload v-bind:albumList.sync="info.albumList" titleWord="" />
              </div>
            </div>
          </div>
          <!-- 分数计算 -->
          <div class="list score_box">
            <div class="list_text_title">
              <span class="text title-text">*评分</span>
            </div>
            <div class="list_con">{{ formScore.ramarkCalcRule }}</div>
            <div class="score_btn score_putone">
              <input class="scroe_input_agg" placeholder="请输入" v-model="score" type="number" readonly />
              <div class="score_hint">分</div>
            </div>
          </div>
          <div class="list" v-if="$route.query.id && $route.query.status != '5'">
            <div class="list_text_title">
              <span class="text">审核意见</span>
            </div>
            <div class="list_con" v-html="removeHtmlStyle(info.confirmSuggestion)"></div>
          </div>
        </div>
      </div>
      <div class="fead_boot">
        <div class="btn_li" @click="departInsert(0)">提交</div>
        <div class="btn_li" @click="departInsert(1)">提交并录入下一个</div>
      </div>
    </div>
    <videoPreview class="video_box" :show="videoPlayShow" :src="videoPlayUrl" @close="videoClose" />
  </div>
</template>

<script>
import MyNavBar from '@com/MyNavBar'
import {
  listIndexList,
  getBonusPointsDetails,
  getListAllUserByOrgId,
  inputBonusPoints,
  selectYearAndQuarter,
} from '@api/api-bonus.js'
import BoardSound from '@com/BoardSound'
import ImgUpload from '@com/ImgUpload'
import videoPreview from '@com/videoPreview'
export default {
  name: 'BonusAdd',
  components: {
    ImgUpload,
    BoardSound,
    MyNavBar,
    videoPreview,
  },
  props: {},
  data() {
    return {
      titlePage: '加分项',
      id: this.$route.query.id,
      taskId: this.$route.query.id,
      result: this.$route.query.result, // 0未通过 1通过 2录入
      videoPlayShow: false,
      videoPlayUrl: '',
      info: {
        albumList: [],
        commentList: [],
        boundsName: '',
        boundsRemark: '',
        boundsTypeName: '',
        enclosureList: [],
        userName: '',
        orgName: '',
        title: '',
        tagName: '',
        saBonusListResponse: '',
        confirmSuggestion: '',
        times: 1,
        headCount: 1,
        boundsYear: '',
        boundsQuarter: '',
      },
      category: '', // 一级加分项类别
      level2: '',
      level3: '',
      levelOption1: [],
      levelOption2: [],
      level2Name: '级别',
      level3Name: '',
      level3optionName: '',
      levelOption3: [],
      ExtraCode: '',
      allData: [
        {
          title: '加分项名称',
          entryCont: '',
          audioList: [],
          placeholder: '填写该加分项的具体名称或简要描述，例如市级先进基层党组织',
          maxlength: 100,
        },
        {
          title: '加分项说明',
          entryCont: '',
          audioList: [],
          placeholder: '对该加分项的详细解释说明，例如xx党支部受xx表彰，获评xx年度市级先进基层党组织',
          maxlength: 200,
        },
      ],
      albumList: [],
      enclosureList: [],
      userInfo: JSON.parse(localStorage.userInfo),
      watchData: [],
      pickerValueY: '',
      pickerValueQ: '',
      showPickerY: false,
      showPickerQ: false,
      columnsOffices: [
        // 所有科室
      ],
      columnsPeoples: [
        // 科室人员
      ],
      organId: JSON.parse(localStorage.userInfo).loginPostInfo.orgId,
      peopleId: '',
      score: '',
      formScore: {},
      remarkList: [],
      checkData: {
        checked1: false,
        checked2: false,
        check1Name: '窗口单位主要领导每月到窗口调研（坐班）',
        check2Name: '窗口工作人员有被提拔使用的（提供相关文件，含职级晋升）',
        check3Name: '办事企业和群众主动评价为“不满意”或“非常不满意”（含书面批评）的',
        check4Name: '对主动评价中有弄虚作假行为，经提醒后不予改正的',
        check5Name: '窗口工作人员被提拔使用（含职级晋升）',
      },
      scoreLow: 1,
      quartYM: '',
      yearQuater: [],
      categoryList: ['7-06-00-00', '8-02-00-00', '5-10-00-00', '7-05-00-00', '9-03-00-00'],
      extraOption: [
        { id: '0', label: '否' },
        { id: '1', label: '是' },
      ],
      extraLabel: '0',
      activeTab: '1',
    }
  },
  computed: {},
  watch: {},
  created() {
    this.activeTab = this.$route.query.applyType
  },
  mounted() {
    this.dealTitle()
    this.selectYearAndQuarter()
    this.oneIndexList('1')
    this.getListAllUserByOrgId()
  },
  methods: {
    dealTitle() {
      switch (this.activeTab) {
        case '1':
          this.titlePage = '个人加分项'
          break
        case '2':
          this.titlePage = '个人减分项'
          break
        default:
          break
      }
    },
    goback() {
      this.$router.go(-1)
    },
    removeHtmlStyle(html) {
      const rel = /style\s*?=\s*?([‘"])[\s\S]*?\1/g
      let newHtml = ''
      if (html) {
        newHtml = html.replace(rel, '')
      }
      return newHtml
    },
    lookTips() {
      this.$router.push({ path: '/bonusRemark', query: { remark: JSON.stringify(this.remarkList) } })
    },

    selectYearAndQuarter() {
      selectYearAndQuarter({
        id: 2,
      }).then(res => {
        if (res.status === 200) {
          const listQuater = res.data
          this.yearQuater = []
          if (listQuater.length > 0) {
            for (const i in listQuater) {
              const year = listQuater[i].year
              for (const j in listQuater[i].list) {
                let quater = '第一季度'
                if (listQuater[i].list[j].quarter === 1) {
                  quater = '第一季度'
                } else if (listQuater[i].list[j].quarter === 2) {
                  quater = '第二季度'
                } else if (listQuater[i].list[j].quarter === 3) {
                  quater = '第三季度'
                } else if (listQuater[i].list[j].quarter === 4) {
                  quater = '第四季度'
                }
                this.yearQuater.push({
                  value: `${year}${listQuater[i].list[j].quarter}`,
                  text: `${year}年${quater}`,
                  year: year,
                  quater: listQuater[i].list[j].quarter,
                  isChoose: listQuater[i].list[j].isChoose,
                })
              }
            }
            let flag = false
            for (let i = 0; i < this.yearQuater.length; i++) {
              if (this.yearQuater[i].isChoose) {
                this.quartYM = this.yearQuater[i].value
                this.info.boundsYear = this.yearQuater[i].year
                this.info.boundsQuarter = this.yearQuater[i].quater
                flag = true
                break
              }
            }
            if (!flag) {
              this.quartYM = this.yearQuater[0].value
              this.info.boundsYear = this.yearQuater[0].year
              this.info.boundsQuarter = this.yearQuater[0].quater
            }
          }
          if (this.$route.query.id) {
            // 获取待修改信息
            this.getApplyParmas()
          }
        }
      })
    },

    quarterChange() {
      this.info.boundsQuarter = this.quartYM.substring(4)
      this.info.boundsYear = this.quartYM.substring(0, 4)
    },

    getApplyParmas() {
      getBonusPointsDetails({
        value: this.$route.query.processInstanceId,
        key: this.id,
      }).then(res => {
        if (res.status === 200) {
          this.info = { ...res.data }
          if (this.info.saBonusListResponse.id === '7-03-00-00') {
            this.allData[0].entryCont = this.info.boundsRemark
          } else if (this.info.saBonusListResponse.id.includes('5-03-02')) {
            this.allData[0].entryCont = this.info.boundsRemark
          } else {
            this.allData[0].entryCont = this.info.boundsName
            this.allData[1].entryCont = this.info.boundsRemark
          }
          if (this.yearQuater && this.yearQuater.length > 0) {
            for (let i = 0; i < this.yearQuater.length; i++) {
              if (
                this.yearQuater[i].year === this.info.boundsYear &&
                this.yearQuater[i].quater === this.info.boundsQuarter
              ) {
                this.quartYM = this.yearQuater[i].value
              }
            }
          }
        }
      })
    },
    getListAllUserByOrgId() {
      // 获取所有科室
      getListAllUserByOrgId({
        id: this.organId,
      }).then(res => {
        if (res.status === 200) {
          const arr = []
          res.data.forEach(item => {
            arr.push({
              text: item.name,
              id: item.id,
            })
          })
          this.columnsPeoples = arr
        }
      })
    },
    onConfirmQ(value) {
      this.pickerValueQ = value.text
      this.peopleId = value.id
      this.oneIndexList('2')
      this.showPickerQ = false
    },
    onPickerShow(type) {
      this.showPickerQ = true
    },
    oneIndexList(type) {
      // 一级加分项
      listIndexList({
        indexType: this.activeTab,
        pcode: '',
        type: 0,
        id: this.id,
        userId: '',
        organId: this.organId,
      }).then(res => {
        if (res.status === 200) {
          this.formScore = res.data[0]
          if (this.formScore.optionType === 'fixed_score') {
            this.score = Number(this.formScore.indexPoint)
          } else if (this.formScore.optionType === 'aggregate_score') {
            this.score = Number(this.formScore.minScore)
          } else {
            this.score = ''
          }
          this.levelOption1 = res.data
          if (this.levelOption1.length > 0) {
            const levelOption1 = this.levelOption1
            if (this.id) {
              levelOption1.forEach((el, index) => {
                if (el.isChoose) {
                  this.category = levelOption1[index].id
                }
              })
            } else {
              this.category = levelOption1[0].id
            }
            this.remarkList = []
            for (const i in this.levelOption1) {
              this.remarkList.push({
                title: this.levelOption1[i].label,
                ramarkCalcRuleShow: this.levelOption1[i].ramarkCalcRuleShow,
              })
            }
          }
          this.ExtraCode = this.category
          this.getExtraListSec(this.category)
          if (!(type === '1' && this.$route.query.id)) {
            this.dealData()
          }
        }
      })
    },
    dealData() {
      if (this.activeTab === '2') {
        this.allData = [
          {
            title: '减分项名称',
            entryCont: '',
            audioList: [],
            placeholder: '填写该加分项的具体名称或简要描述，例如市级先进基层党组织',
            maxlength: 100,
          },
          {
            title: '减分项说明',
            entryCont: '',
            audioList: [],
            placeholder: '对该加分项的详细解释说明，例如xx党支部受xx表彰，获评xx年度市级先进基层党组织',
            maxlength: 200,
          },
        ]
      } else {
        this.allData = [
          {
            title: '加分项名称',
            entryCont: '',
            audioList: [],
            placeholder: '填写该加分项的具体名称或简要描述，例如市级先进基层党组织',
            maxlength: 100,
          },
          {
            title: '加分项说明',
            entryCont: '',
            audioList: [],
            placeholder: '对该加分项的详细解释说明，例如xx党支部受xx表彰，获评xx年度市级先进基层党组织',
            maxlength: 200,
          },
        ]
      }
      this.checkData.checked1 = false
      this.checkData.checked2 = false
      this.info.times = 1
      this.info.headCount = 1
      this.scoreLow = 1
    },
    getExtraListSec(code) {
      // 二级加分项
      listIndexList({
        indexType: this.activeTab,
        pcode: code,
        type: 1,
        id: this.id,
      }).then(res => {
        if (res.status === 200) {
          this.levelOption2 = res.data
          if (this.levelOption2.length > 0) {
            this.formScore = res.data[0]
            if (this.formScore.optionType === 'fixed_score') {
              this.score = Number(this.formScore.indexPoint)
            } else if (this.formScore.optionType === 'aggregate_score') {
              this.score = Number(this.formScore.minScore)
            } else {
              this.score = ''
            }

            if (this.id) {
              const levelOption2 = this.levelOption2
              levelOption2.forEach((el, index) => {
                if (el.isChoose) {
                  this.level2 = levelOption2[index].id
                }
              })
            } else {
              this.level2 = res.data[0].id
            }
            this.ExtraCode = this.level2
            this.level2Name = res.data[0].remark
            this.getExtraListThree(this.level2)
          }
        }
      })
    },
    getExtraListThree(code) {
      // 三级加分项
      listIndexList({
        indexType: this.activeTab,
        pcode: code,
        type: 1,
        id: this.id,
      }).then(res => {
        if (res.status === 200) {
          this.levelOption3 = res.data
          if (this.levelOption3.length > 0) {
            this.formScore = res.data[0]
            if (this.formScore.optionType === 'fixed_score') {
              this.score = Number(this.formScore.indexPoint)
            } else if (this.formScore.optionType === 'aggregate_score') {
              this.score = Number(this.formScore.minScore)
            } else {
              this.score = ''
            }
            if (this.id) {
              const levelOption3 = this.levelOption3
              levelOption3.forEach((el, index) => {
                if (el.isChoose) {
                  this.level3 = levelOption3[index].id
                }
              })
              this.ExtraCode = this.level3
              this.level3Name = res.data[0].remark
              if (this.level3Name === '加分项名称') {
                this.allData = [
                  {
                    title: '加分项说明',
                    entryCont: this.info.boundsRemark,
                    audioList: [],
                    placeholder: '对该加分项的详细解释说明，例如xx党支部受xx表彰，获评xx年度市级先进基层党组织',
                    maxlength: 200,
                  },
                ]
                this.level3optionName = res.data[0].label
              } else {
                this.ExtraCode = this.level3
                this.allData = [
                  {
                    title: '加分项名称',
                    entryCont: this.info.boundsName,
                    audioList: [],
                    placeholder: '填写该加分项的具体名称或简要描述，例如市级先进基层党组织',
                    maxlength: 100,
                  },
                  {
                    title: '加分项说明',
                    entryCont: this.info.boundsRemark,
                    audioList: [],
                    placeholder: '对该加分项的详细解释说明，例如xx党支部受xx表彰，获评xx年度市级先进基层党组织',
                    maxlength: 200,
                  },
                ]
              }
            } else {
              this.level3 = res.data[0].id
              this.ExtraCode = this.level3
              this.level3Name = res.data[0].remark
              if (this.level3Name === '加分项名称') {
                this.allData = [
                  {
                    title: '加分项说明',
                    entryCont: this.info.boundsRemark,
                    audioList: [],
                    placeholder: '对该加分项的详细解释说明，例如xx党支部受xx表彰，获评xx年度市级先进基层党组织',
                    maxlength: 200,
                  },
                ]
                this.level3optionName = res.data[0].label
              } else {
                this.ExtraCode = this.level3
                this.allData = [
                  {
                    title: '加分项名称',
                    entryCont: this.info.boundsName,
                    audioList: [],
                    placeholder: '填写该加分项的具体名称或简要描述，例如市级先进基层党组织',
                    maxlength: 100,
                  },
                  {
                    title: '加分项说明',
                    entryCont: this.info.boundsRemark,
                    audioList: [],
                    placeholder: '对该加分项的详细解释说明，例如xx党支部受xx表彰，获评xx年度市级先进基层党组织',
                    maxlength: 200,
                  },
                ]
              }
            }
          }
        }
      })
    },
    clickRadio(item) {
      // 点击一级加分项
      this.formScore = item
      if (this.formScore.optionType === 'fixed_score') {
        this.score = Number(this.formScore.indexPoint)
      } else if (this.formScore.optionType === 'aggregate_score') {
        this.score = Number(this.formScore.minScore)
      } else {
        this.score = ''
      }
      this.id = ''
      this.levelOption2 = []
      this.levelOption3 = []
      this.getExtraListSec(item.id)
      this.ExtraCode = item.id
      this.dealData()
    },
    clickRadioSec(item) {
      // 点击二级加分项
      this.formScore = item
      if (this.formScore.optionType === 'fixed_score') {
        this.score = Number(this.formScore.indexPoint)
      } else if (this.formScore.optionType === 'aggregate_score') {
        this.score = Number(this.formScore.minScore)
      } else {
        this.score = ''
      }
      this.id = ''
      this.levelOption3 = []
      this.getExtraListThree(item.id)
      this.ExtraCode = item.id
    },
    clickRadioThr(item) {
      this.id = ''
      this.formScore = item
      if (this.formScore.optionType === 'fixed_score') {
        this.score = Number(this.formScore.indexPoint)
      } else if (this.formScore.optionType === 'aggregate_score') {
        this.score = Number(this.formScore.minScore)
      } else {
        this.score = ''
      }
      // 点击三级加分项
      if (this.level3Name === '加分项名称') {
        if (item.label === '其他') {
          this.level3optionName = ''
          this.allData = [
            {
              title: '加分项名称',
              entryCont: this.info.boundsName,
              audioList: [],
              placeholder: '填写该加分项的具体名称或简要描述，例如市级先进基层党组织',
              maxlength: 100,
            },
            {
              title: '加分项说明',
              entryCont: this.info.boundsRemark,
              audioList: [],
              placeholder: '对该加分项的详细解释说明，例如xx党支部受xx表彰，获评xx年度市级先进基层党组织',
              maxlength: 200,
            },
          ]
        } else {
          this.level3optionName = item.label
          this.allData = [
            {
              title: '加分项说明',
              entryCont: this.info.boundsRemark,
              audioList: [],
              placeholder: '对该加分项的详细解释说明，例如xx党支部受xx表彰，获评xx年度市级先进基层党组织',
              maxlength: 200,
            },
          ]
        }
      } else {
        this.level3optionName = ''
        this.allData = [
          {
            title: '加分项名称',
            entryCont: this.info.boundsName,
            audioList: [],
            placeholder: '填写该加分项的具体名称或简要描述，例如市级先进基层党组织',
            maxlength: 100,
          },
          {
            title: '加分项说明',
            entryCont: this.info.boundsRemark,
            audioList: [],
            placeholder: '对该加分项的详细解释说明，例如xx党支部受xx表彰，获评xx年度市级先进基层党组织',
            maxlength: 200,
          },
        ]
      }
      this.ExtraCode = item.id
    },
    // 预览图片
    previewImage(index) {
      const imagesArr = this.albumList.map(item => item.thumbnailPath)
      this.$ImagePreview({
        images: imagesArr,
        startPosition: index,
        loop: false,
        onChange(index) {
          if (index === imagesArr.length - 1 && imagesArr.length > 1) {
            this.$toast('这是最后一张了')
          }
        },
      })
    },
    // 视频播放
    playVideoItem(item) {
      this.videoPlayUrl = item.sourcePath
      this.videoPlayShow = true
    },
    // 视频关闭
    videoClose() {
      this.videoPlayUrl = ''
      this.videoPlayShow = false
    },

    departInsert(saveStatus) {
      let boundsName = ''
      let boundsRemark = ''
      if (this.peopleId === '') {
        this.$toast.fail('请选择人员')
        return
      }

      let headCount = ''
      let times = ''
      let bonusName = ''
      const scoreInput = Number(this.score)
      const maxScore = Number(this.info.maxScore)
      const minScore = Number(this.info.minScore)
      if (scoreInput > maxScore || scoreInput < minScore) {
        this.$toast.fail('请输入正确分值')
        return
      }
      if (this.level3Name === '加分项名称' && this.level3optionName) {
        boundsName = this.level3optionName
        boundsRemark = this.allData[0].entryCont
      } else {
        boundsName = this.allData[0].entryCont
        boundsRemark = this.allData[1].entryCont
      }
      boundsName = boundsName || bonusName
      if (boundsName === '' || boundsRemark === '') {
        this.$toast.fail('请填写加分项名称和说明')
        return
      }
      // if (this.info.commentList.length === 0) {
      //   this.$toast.fail('请上传证明材料')
      //   return
      // }
      inputBonusPoints({
        orgId: this.organId,
        userId: this.peopleId,
        boundsName: boundsName, // 加分项名称
        boundsRemark: boundsRemark, // 加分项说明
        boundsType: this.ExtraCode, // 加分项类别code
        albumList: this.info.albumList, // 相册
        commentList: this.info.commentList, // 相册
        enclosureList: this.info.enclosureList, // 附件
        score: scoreInput,
        times: times,
        headCount: headCount,
        applyType: this.activeTab === '1' ? '2' : '5',
        boundsYear: parseFloat(this.info.boundsYear),
        boundsQuarter: parseFloat(this.info.boundsQuarter),
      }).then(res => {
        if (res.status === 200) {
          this.$toast.success(res.message)
          if (saveStatus === 0) {
            this.$router.go(-1)
          } else {
            this.clearData()
          }
        }
      })
    },

    clearData() {
      this.pickerValueY = ''
      this.pickerValueQ = ''
      this.organId = ''
      this.peopleId = ''
      this.info.albumList = []
      this.info.commentList = []
      this.info.enclosureList = []
      this.level3optionName = ''
      this.allData[0].entryCont = ''
      this.allData[0].audioList = []
      if (this.allData.length > 1) {
        this.allData[1].entryCont = ''
        this.allData[1].audioList = []
      }
      if (this.formScore.optionType === 'aggregate_score') {
        this.score = Number(this.formScore.minScore)
      } else {
        this.score = Number(this.formScore.indexPoint)
      }
      this.checkData.checked1 = false
      this.checkData.checked2 = false
      this.info.times = 1
      this.info.headCount = 1
      this.scoreLow = 1
    },
  },
}
</script>

<style lang="scss" scoped>
.page_padding {
  background: #f5f5f5;
  .content {
    padding-bottom: 50px;
    /deep/ .van-popup {
      position: absolute;
    }
    /deep/ .van-overlay {
      position: absolute;
    }
    .top_tips {
      padding: 0 16px;
      color: #004db6;
      height: 30px;
      display: flex;
      align-items: center;
      /deep/.van-icon-info-o {
        // margin-top: 10px;
        color: #333;
      }
    }
    .cont_tit {
      padding: 12px 30px;
      background: #fff;
      .peoIcon {
        font-size: 45px;
        color: #929191;
        margin-top: 5px;
      }
      .info_deta {
        p {
          margin-top: 8px;
        }
        & p:nth-child(1) {
          color: #ad7316;
          font-size: 14px;
          span {
            color: #666666;
            font-size: 13px;
            margin-left: 10px;
          }
        }
        & p:nth-child(2) {
          color: #333333;
          font-size: 13px;
        }
      }
    }
    .fill {
      background-color: #fff;
      padding-bottom: 15px;
      // 标题
      .list_text_title {
        font-weight: bold;
        color: #333;
        margin-bottom: 10px;
      }
      .tips_r {
        font-size: 12px;
        .tips_r_color {
          color: #a7a7a7;
        }
      }
      .cont_box {
        border-radius: 2px;
        margin: 0 16px;
        .depar_box {
          padding: 20px 0;
          padding-bottom: 0;
          background-color: #ffffff;
          .depart_con {
            border-bottom: 1px solid #efefef;
            .depart_list {
              display: flex;
              align-items: center;
              justify-content: space-between;
              font-size: 13px;
              margin-bottom: 16px;
              .depart_list_name {
                color: #333333;
              }
              .depart_list_val {
                color: #999999;
                display: flex;
                align-items: center;
                justify-content: center;
              }
            }
          }
        }
        //加分项类别
        .category {
          padding: 16px 0;
          border-bottom: 1px solid #efefef;
          background-color: #ffffff;
          .category_con {
            .option_item {
              width: 100%;
              /deep/.van-radio__icon {
                height: auto;
                line-height: initial;
                width: 100%;
              }
            }
            .category_list {
              line-height: 16px;
              display: flex;
              align-items: center;
              color: #333333;
              font-size: 13px;
              padding: 5px 20px;
              border: 1px solid transparent;
              background-color: #f4f4f4;
              margin-bottom: 8px;
              &.active {
                background-color: rgba(0, 77, 182, 0.15);
                color: #0f61d5;
                border: 1px solid #0f61d5;
              }
            }
          }
        }
        .list {
          margin-bottom: 16px;
          .list_text_title {
            font-weight: bold;
            color: #333;
            margin-bottom: 10px;
            .text {
              background-image: linear-gradient(#ffffff 50%, #e5d2b4);
            }
          }
          .list_con {
            font-size: 14px;
            line-height: 25px;
            color: red;
          }
          .score_btn {
            display: flex;
            align-items: center;
            margin-top: 15px;
            height: 35px;
            line-height: 35px;
            /deep/.van-radio__icon {
              height: auto;
            }
            .score_hint {
              font-size: 12px;
              width: 25px;
              text-align: center;
              height: 32px;
              line-height: 32px;
              background-color: #f0f0f0;
              border: solid 1px #cccccc;
              border-left: none;
              color: #666666;
              margin-right: 8px;
            }
          }
          .score_putone {
            input::-webkit-outer-spin-button,
            input::-webkit-inner-spin-button {
              -webkit-appearance: none;
            }
            input[type='number'] {
              -moz-appearance: textfield;
            }
          }
          .scroe_input_agg {
            width: 40%;
            display: block;
            height: 29px;
            line-height: 29px;
            font-size: 13px;
            text-indent: 15px;
            border: solid 1px #cccccc;
          }
          // 图片附件
          .img_annex {
            padding-top: 10px;
            .img {
              margin-bottom: 6px;
            }
          }
        }
        // 附件
        .annex {
          background-color: #fff;
          margin-top: 10px;
          border-radius: 10px;
          padding: 20px 0;

          .img_video {
            padding: 0;
            border-bottom: 1px solid #f0f0f0;

            .up_box {
              padding-bottom: 8px;
              font-size: 13px;
            }
          }
        }
        .texe_select {
          /deep/.van-radio-group {
            .van-radio {
              margin-right: 15px;
              margin-bottom: 10px;
            }
          }
          /deep/ .van-dropdown-menu__item {
            justify-content: left;
          }
        }
        .entry_list {
          border-bottom: 1px solid #efefef;
          /deep/.entry_sound {
            box-shadow: none;
            .list_text_title {
              padding-left: 0;
              padding-right: 0;
            }
            .list_text_box {
              padding: 10px 0;
            }
          }
        }
      }
    }
    .fead_boot {
      .btn_li {
        width: 40%;
      }
    }
  }
}
</style>
